| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkScripts::Namespace Class Referenceabstract

Holds information and allow control over a namespace in a scripting environment. More...

## Public Member Functions
| Namespace (nkMemory::StringView name) noexcept
virtual | ~Namespace ()
nkMemory::StringView | getName () const
virtual Namespace * | getNamespace (nkMemory::StringView name) const =0
virtual UserType * | getUserType (nkMemory::StringView name) const =0
virtual void | setVar (nkMemory::StringView name, bool value)=0
virtual void | setVar (nkMemory::StringView name, int value)=0
virtual void | setVar (nkMemory::StringView name, float value)=0
virtual void | setVar (nkMemory::StringView name, double value)=0
void | setVar (nkMemory::StringView name, const char *value)
virtual void | setVar (nkMemory::StringView name, nkMemory::StringView value)=0
virtual void | setVar (nkMemory::StringView name, const ScriptObjectReference &value)=0
virtual void | setObject (nkMemory::StringView name, nkMemory::StringView userTypeName, void *value)=0
virtual Namespace * | setNamespace (nkMemory::StringView name)=0
virtual UserType * | setUserType (nkMemory::StringView name)=0
virtual Function * | setFunc (nkMemory::StringView name)=0
virtual void | shutdown ()=0
virtual void | reset ()=0

## Detailed Description

Holds information and allow control over a namespace in a scripting environment.

## Constructor & Destructor Documentation

## ◆ Namespace()

nkScripts::Namespace::Namespace | ( | nkMemory::StringView | name | ) |
| noexcept

Constructor.

Parameters

  name | The namespace name.

## ◆ ~Namespace()

virtual nkScripts::Namespace::~Namespace | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ getName()

nkMemory::StringView nkScripts::Namespace::getName | ( |  | ) | const

Returns
  The namespace name.

## ◆ getNamespace()

virtual Namespace* nkScripts::Namespace::getNamespace | ( | nkMemory::StringView | name | ) | const
| pure virtual

Parameters

  name | The name of the sub namespace to retrieve.

Returns
  The sub namespace if available, nullptr else.

## ◆ getUserType()

virtual UserType* nkScripts::Namespace::getUserType | ( | nkMemory::StringView | name | ) | const
| pure virtual

Parameters

  name | The name of the user type to retrieve.

Returns
  The user type defined in the namespace if available, nullptr else.

## ◆ setVar() [1/7]

virtual void nkScripts::Namespace::setVar | ( | nkMemory::StringView | name,
|  | bool | value
| ) |  |
| pure virtual

Sets a variable within the namespace.

Parameters

  name | The name of the variable to set.
  value | The value it should have.

## ◆ setVar() [2/7]

virtual void nkScripts::Namespace::setVar | ( | nkMemory::StringView | name,
|  | int | value
| ) |  |
| pure virtual

Sets a variable within the namespace.

Parameters

  name | The name of the variable to set.
  value | The value it should have.

## ◆ setVar() [3/7]

virtual void nkScripts::Namespace::setVar | ( | nkMemory::StringView | name,
|  | float | value
| ) |  |
| pure virtual

Sets a variable within the namespace.

Parameters

  name | The name of the variable to set.
  value | The value it should have.

## ◆ setVar() [4/7]

virtual void nkScripts::Namespace::setVar | ( | nkMemory::StringView | name,
|  | double | value
| ) |  |
| pure virtual

Sets a variable within the namespace.

Parameters

  name | The name of the variable to set.
  value | The value it should have.

## ◆ setVar() [5/7]

void nkScripts::Namespace::setVar | ( | nkMemory::StringView | name,
|  | const char * | value
| ) |  |

Sets a variable within the namespace.

Parameters

  name | The name of the variable to set.
  value | The value it should have.

## ◆ setVar() [6/7]

virtual void nkScripts::Namespace::setVar | ( | nkMemory::StringView | name,
|  | nkMemory::StringView | value
| ) |  |
| pure virtual

Sets a variable within the namespace.

Parameters

  name | The name of the variable to set.
  value | The value it should have.

## ◆ setVar() [7/7]

virtual void nkScripts::Namespace::setVar | ( | nkMemory::StringView | name,
|  | const ScriptObjectReference & | value
| ) |  |
| pure virtual

Sets a variable within the namespace.

Parameters

  name | The name of the variable to set.
  value | The value it should have.

## ◆ setObject()

virtual void nkScripts::Namespace::setObject | ( | nkMemory::StringView | name,
|  | nkMemory::StringView | userTypeName,
|  | void * | value
| ) |  |
| pure virtual

Sets an object within the namespace.

Parameters

  name | The name of the object to set.
  userTypeName | The user type name identifying the type of the object to set.
  value | The user data pointer to attach.

## ◆ setNamespace()

virtual Namespace* nkScripts::Namespace::setNamespace | ( | nkMemory::StringView | name | ) |
| pure virtual

Sets a sub namespace.

Parameters

  name | The name of the sub namespace to set.

Returns
  The newly created namespace. External code does not own it, it should not delete it.

## ◆ setUserType()

virtual UserType* nkScripts::Namespace::setUserType | ( | nkMemory::StringView | name | ) |
| pure virtual

Sets a user type.

Parameters

  name | The name of the type to set.

Returns
  The newly created user type. External code does not own it, it should not delete it.

## ◆ setFunc()

virtual Function* nkScripts::Namespace::setFunc | ( | nkMemory::StringView | name | ) |
| pure virtual

Sets a function.

Parameters

  name | The name of the sub namespace to set.

Returns
  The newly created function. External code does not own it, it should not delete it.

## ◆ shutdown()

virtual void nkScripts::Namespace::shutdown | ( |  | ) |
| pure virtual

Prepares the namespace for shutdown. In theory, should never be called by external code.

## ◆ reset()

virtual void nkScripts::Namespace::reset | ( |  | ) |
| pure virtual

Resets the namespace, to free all sub namespaces, functions, user types set on it.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsScripts/Environments/Namespaces/Namespace.h